home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 3.4 KB | 85 lines | [TEXT/GEOL] |
- Item 4199271 7-June-90 16:04PDT
-
- From: D5780 Stat-Ease, Robert Altman,PRT
-
- To: MACAPP.TECH$ MacApp Technical
- MOOF Rollin, Keith A
-
- Sub: New Poject: TFloatGridView
-
- Fellow MacApp-ites,
-
- I wish to announce a new classroom project and to solicite help and/or advice
- for that same project.
-
- The project is this: Create a spreadsheet style editor that allows in-place
- editing of the cells. To accomplish this, we use a GridView object coupled
- with a "floating" TEditText object. The GridView handles the display,
- scrolling, and selection of text (or whatever). A floating TEditText handles
- all the editing (and validation). See Keith Rollins article "Children of the
- DogCow: TFloatingGridView" in Frameworks, September 1989 (Vol. 3, Num. 3) for a
- discussion of a similar project.
-
- I am uploading an unit called UFloatGridView to the classroom area. The unit
- contains the entire implementation of the floating GridView. Unfortunately, I
- don't have a "shell" application to use for testing this unit at this point in
- time.
-
- There are two immediate problems to tackle with this project.
-
- First, the TEditText object (our floating editor) is too specific to text. I
- was thinking of replacing that with an object TValidText - which had a validate
- method so that other object could be descended from it. The validate method
- would default to TRUE - in all other respects, this would be the same as a
- TEditText.
-
- Second, I am currently trying to fix the editor so that it handles highlighting
- correctly. It is possible to disable TGridView's highlighting abilities be
- overriding CellsToPixels (Call SetEmptyRgn); this is necessary because the
- TEditText must handle the highlighting for editing purposes. However, this
- approach prevents the GridView from highlighting the currently selected cell
- while the mouse button is depressed. It seems intuitive that the currently
- pointed-at cell should be highlighted while the user is "roaming" around the
- spreadsheet with the mouse button down. A possible solution is to keep a state
- variable (isFloating) and use the folowing code for CellsToPixels:
-
- procedure TFloatGridView.CellsToPixels(theCells,thePixels:RgnHandle); OVERRIDE;
-
- begin
- if isFloating then
- Inherited CellsToPixels(theCells, thePixels)
- else
- SetEmptyRgn(thePixels);
- end;
-
- In this way, CellsToPixels will act differently depending on how we want it to
- behave. Here's the catch: when do we set isFlaoting to true? Answer: on a
- MouseDown within the bounds on the GridView but outside of the EditText.
- Locating the MouseDown event (where it happened) seems easy (using MacApp's
- Target chain), however, I haven't figured out how to trap the MouseDown event -
- and I fear that it might be ugly and unMacAppish.
-
- There's the project and the problem.
-
- ----------------------------------------------------------------------------
-
- The Project: TFloatGridView
-
- Project leader: Robert D. Altman
- Voice access: 612-378-9449 (Central Time)
- AppleLink: D5780 (may change in the near future)
- MacApp version: 2.0ß9
- Initial release: June 7, 1990
- Last update: June 7, 1990
- Current version: 1.0
-
- ----------------------------------------------------------------------------
-
- Looking forward to a really neat unit,
-
- Robert D. Altman
- Stat-Ease, Inc.
- Minneapolis, MN
-
-
-